package com.smartHome.utils;

import java.security.SecureRandom;

public class VerificationCodeUtil {
    private static final String CHARACTERS = "0123456789";
    private static SecureRandom random = new SecureRandom();

    public static String generateVerificationCode() {
        StringBuilder sb = new StringBuilder(4);
        for (int i = 0; i < 5; i++) {
            sb.append(CHARACTERS.charAt(random.nextInt(CHARACTERS.length())));
        }
        return sb.toString();
    }

}
